from sqlalchemy import String, DECIMAL, DateTime, Integer, Column

from config.database import Base


class StatPosition(Base):
    """
    股票交易统计表
    """

    __tablename__ = 'stock_stat_position'
    __table_args__ = {'comment': '股票交易统计表'}

    trade_date = Column(DateTime, primary_key=True, nullable=True, comment='交易日期')
    account_tag = Column(String(64), primary_key=True, nullable=True, comment='股票账号标签')
    stock_code = Column(String(20), primary_key=True, nullable=True, comment='证券代码')
    stock_name = Column(String(100), nullable=True, comment='证券名称')
    amount = Column(DECIMAL, nullable=True, comment='买入金额')
    quantity = Column(Integer, nullable=True, comment='买入数量')
    create_time = Column(DateTime, nullable=True, comment='创建时间')
